
***************Figure 3**************

********************************
*****Open 2020_MTurk_Data.dta
*********************************

***create variable for anger vs. control article condition
tab condition
gen angrcon=condition
recode angrcon (1=1) (2=0)
tab angrcon condition


****create variable for coping conditions
tab acon
gen copecon=acon
recode copecon (1=0) (2=1) (3=2) (4=2)
tab copecon

***create variable for coping conditions among those who read the anger article
tab acon
gen angcope=.
replace angcope=0 if angrcon==1 & acon==1
replace angcope=1 if angrcon==1 & acon==2
replace angcope=2 if angrcon==1 & acon==3
tab angcope
****0=confront terrorism 1=act on transportation 2=control




******Recode anger variables 0 - 1

***Anger at T1
tab anger1
gen angert1=anger1
recode angert1 (1=1) (2=.66) (3=.33) (4=0) 
tab angert1
tab anger1


***Anger at T2
tab anger2
gen angert2=anger2
recode angert2 (1=1) (2=.66) (3=.33) (4=0) 
tab angert2
tab anger2


**Change data from wide form on time to long form
*******create ID varaiabl
gen id = _n
********reshape data
reshape long angert, i(id) j(time)  


*************Save Data as long form**************



*********************************************************


********************************
*****Open MTurk_2020_long_form.dta
*********************************

*****Anger/Distancing  v. Control/Control
gen angtransvcontcont=.
replace angtransvcontcont=1 if angcope==1
replace angtransvcontcont=0 if acon==4
tab angtransvcontcont

reg angert i.time##i.angtransvcontcont

margins r.time, over(angtransvcontcont)
****Distancing Slope=-.215**
****Control Slope=.003

**Difference between control and anger conditions at t1 and t2
margins r.angtransvcontcont, over(time)
****Difference T1=.370
****Difference T2=.151


***Difference in Differences
margins r.time, over(r.angtransvcontcont)
*******Difference in Difference = -.218

#delimit;
reg angert i.time##i.angtransvcontcont;
margins time#angtransvcontcont, saving(distancing, replace);

#delimit;
marginsplot, title("Anger/Emotion-Focused v. Control/Control")
plot1opts(mcolor(black) msymbol(triangle_hollow) lcolor(black) msize(medlarge) lpat(shortdash)) ci1opts(lcolor(black) lpat(shortdash))
plot2opts(mcolor(black) lcolor(black) msize(medlarge) lpat(solid)) ci2opts(lcolor(black) lpat(solid))
xlabel(1 "Time 1" 2 "Time 2", labsize(3.5)) xtitle("") xscale(r (.6 2.4))
ylabel( 0(.1).6, axis(1) nogrid labsize(2.5)) ytitle("Mean Anger") 
ysc(titlegap(3))
graphregion(color(white)) 
legend(order(4 "Anger Article/Emotion-Focused" 3 "Control Article/Control") cols(1))
text(.36 .94  "`=ustrunescape("\u23A7")'" "`=ustrunescape("\u23A8")'"  "`=ustrunescape("\u23A9")'" , size(43pt) color(gray))
text(.33 .74 "Difference = .370", size(small))
text(.239 2.05  "`=ustrunescape("\u23AB")'" "`=ustrunescape("\u23AC")'"  "`=ustrunescape("\u23AD")'" , size(20pt) color(gray))
text(.23 2.24 "Difference = .151", size(small))
text(.37 1.45 "Slope = -.215", size(small))
text(.12 1.45 "Slope = .003", size(small))
saving(distancing, replace);

#delimit cr

*****Anger/Confrontation  v. Control/Control
gen angconfrvcontcont=.
replace angconfrvcontcont=1 if angcope==0
replace angconfrvcontcont=0 if acon==4
tab angconfrvcontcont

reg angert i.time##i.angconfrvcontcont

margins r.time, over(angconfrvcontcont)
******Confrontation slope=-.094
******Control slope=.003

**Difference between control and anger conditions at t1 and t2
margins r.angconfrvcontcont, over(time)
******Difference T1=.375
******Difference T2=.278

***Difference in Differences
margins r.angconfrvcontcont, over(r.time)
*********Difference=-.0970126

#delimit;
reg angert i.time##i.angconfrvcontcont;
margins time#angconfrvcontcont, saving(confrontation, replace);

#delimit;
marginsplot, title("Anger/Problem-Focused v. Control/Control")
plot1opts(mcolor(black) msymbol(triangle_hollow) lcolor(black) msize(medlarge) lpat(shortdash)) ci1opts(lcolor(black) lpat(shortdash))
plot2opts(mcolor(black) msymbol(square)  lcolor(black) msize(medlarge) lpat(solid)) ci2opts(lcolor(black) lpat(solid))
xlabel(1 "Time 1" 2 "Time 2", labsize(3.5)) xtitle("") xscale(r (.6 2.4))
ylabel( 0(.1).6, axis(1) nogrid labsize(2.5)) ytitle("Mean Anger") 
ysc(titlegap(3))
graphregion(color(white))
legend(order(4 "Anger Article/Problem-Focused" 3 "Control Article/Control") cols(1))
text(.36 .94  "`=ustrunescape("\u23A7")'" "`=ustrunescape("\u23A8")'"  "`=ustrunescape("\u23A9")'" , size(43pt) color(gray))
text(.33 .74 "Difference = .375", size(small))
text(.31 2.05  "`=ustrunescape("\u23AB")'" "`=ustrunescape("\u23AC")'"  "`=ustrunescape("\u23AD")'" , size(33pt) color(gray))
text(.29 2.25 "Difference = .278", size(small))
text(.44 1.45 "Slope = -.094", size(small))
text(.12 1.45 "Slope = .003", size(small))
saving(confrontation, replace);


****Figure 5 - combine distancing and confrontation graphs******

#delimit ;
gr combine distancing.gph confrontation.gph,
graphregion(color(white)) xsize(10) iscale(.9);

#delimit ;
graph export  Figure3.jpg,  replace height(1000);

#delimit cr

******Difference in Difference in Difference***********

***Difference in Emotion-Focused anger vs control at T1 and T2 compared to difference in Problem-Fogcused anger vs control at T1 and T2****


reg angert i.time##i.condition##i.copecon
margins i.time#i.condition#i.copecon, post coefl
***in margins table: column 1 refers to time (t1 vs. t2)
***column 2 refers to the article treatment (1=anger, 2=control)
***column 3 refers to the coping strategy (0=problem-focused, 1=emotion-focused, 2=control)

**********Difference in Difference Emotion Focused**************
***Anger at T1, anger article, emotion focused = row in margins table 1 1 1 = .515  vs. 
***Anger at T1, control article, controle coping = row in magins table 1 2 2 = .145
lincom _b[1bn.time#1bn.condition#1bn.copecon] - _b[1bn.time#2.condition#2.copecon]
*******.370, p<.01

***Anger at T2, anger article, emotion focused = row in margins table 2 1 1 = .2997
***Anger at T1, control article, control coping = row in magins table 2 2 2 = .1486
lincom _b[2bn.time#1bn.condition#1bn.copecon] - _b[2bn.time#2.condition#2.copecon]
********.151, p<.01


lincom (_b[1bn.time#1bn.condition#1bn.copecon] - _b[1bn.time#2.condition#2.copecon]) - (_b[2bn.time#1bn.condition#1bn.copecon] - _b[2bn.time#2.condition#2.copecon])
***.218 p<.01

**********Difference in Difference Problem Focused**************
***Anger at T1, anger article, problem focused = row in margins table 1 1 0 = .521  vs. 
***Anger at T1, control article, control coping = row in magins table 1 2 2 = .145
lincom _b[1bn.time#1bn.condition#0bn.copecon] - _b[1bn.time#2.condition#2.copecon]
*******.375, p<.01

***Anger at T2, anger article, problem focused = row in margins table 2 1 0 = .4266
***Anger at T1, control article, controle coping = row in magins table 2 2 2 = .1486
lincom _b[2bn.time#1bn.condition#0bn.copecon] - _b[2bn.time#2.condition#2.copecon]
********.278, p<.01

***Difference in difference between the previous two
lincom (_b[1bn.time#1bn.condition#0bn.copecon] - _b[1bn.time#2.condition#2.copecon]) - (_b[2bn.time#1bn.condition#0bn.copecon] - _b[2bn.time#2.condition#2.copecon])
***.097 p<.01

*********Difference in Difference in Difference************
lincom [(_b[1bn.time#1bn.condition#1bn.copecon] - _b[1bn.time#2.condition#2.copecon]) - (_b[2bn.time#1bn.condition#1bn.copecon] - _b[2bn.time#2.condition#2.copecon])] - [(_b[1bn.time#1bn.condition#0bn.copecon] - _b[1bn.time#2.condition#2.copecon]) - (_b[2bn.time#1bn.condition#0bn.copecon] - _b[2bn.time#2.condition#2.copecon])]
*******.12, p<.01
